const POST = "8001";
var ws = require("nodejs-websocket");

var server = ws.createServer(function (conn) {
    console.log("New connection")
    conn.on("text", function (str) {
        console.log("Received " + str)
        conn.sendText(str)
    })
    conn.on("close", function (code, reason) {
        console.log("Connection closed")
    })
}).listen(8001)

console.log("WebSocket Server Linstening on POST:" + POST);